<template>
  <el-container>
    <el-header>
<!--      <WebMenu></WebMenu>-->
      <el-menu
          :default-active="activeIndex2"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b">
        <el-menu-item
            style="margin: 0;">
          <div class="block">
            <el-image
                style="width: 100px;height: 50px"
                :src="url"
                fit="scale-down"></el-image>
          </div>
        </el-menu-item>
        <el-menu-item index="/index">首页</el-menu-item>
        <el-menu-item @click="test">购票</el-menu-item>
        <el-submenu index="2">
          <template slot="title" >我的工作台</template>
          <el-menu-item index="/nnn">选项1</el-menu-item>
          <!--          <el-menu-item index="2-2">选项2</el-menu-item>-->
          <!--          <el-menu-item index="2-3">选项3</el-menu-item>-->
          <!--          <el-submenu index="2-4">-->
          <!--            <template slot="title">选项4</template>-->
          <!--            <el-menu-item index="2-4-1">选项1</el-menu-item>-->
          <!--            <el-menu-item index="2-4-2">选项2</el-menu-item>-->
          <!--            <el-menu-item index="2-4-3">选项3</el-menu-item>-->
          <!--          </el-submenu>-->
        </el-submenu>
        <!--        <el-menu-item index="3">消息中心</el-menu-item>-->
        <el-menu-item index="/webMenu/WebMovie" >电影</el-menu-item>
        <el-submenu style="float: right">
          <template slot="title" >
            <el-image
                style="width: 40px;height: 40px;"
                :src="url"
                fit="scale-down"></el-image>
          </template>
          <el-menu-item index="" @click="handlePushUserOrder">我的订单</el-menu-item>
          <el-menu-item index="" @click="handlePushInformation">基本信息</el-menu-item>
          <el-menu-item index="/mmm">退出登录</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-header>
    <el-main>
      <router-view></router-view>
    </el-main>
  </el-container>
</template>

<script>
// import WebMenu from "@/components/WebMenu";
export default {
  name: "WebMenuView",
  // components: {WebMenu},
  data() {
    return {
      activeIndex: '1',
      activeIndex2: '1',
      url: ''
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      this.$router.push({path: key})
    },
    test(){
      this.$router.push({path: "/webMenu/shop" , query:{
         cinema:{
           id:1
         }
        }})
    },
    handlePushUserOrder(){
      this.$router.push({path: "/webMenu/userMenu/userOrder", query: {
        header: "我的订单"
      }})
    },
    handlePushInformation(){
      this.$router.push({path: "/webMenu/userMenu/information", query: {
        header: "我的基本信息"
      }})
    }
  }
}
</script>

<style scoped>

</style>